package operation;

import book.Book;
import book.BookList;

public class FindOperation implements IOperation{
    public void work(BookList bookList){
//        System.out.println("查找图书");
        System.out.println("请输入寻找图书的名字");
        String name = scanner.nextLine();
        int count = bookList.getCount();
        for (int i = 0; i < count; i++) {
            Book book = bookList.getBook(i);
            if (name.equals((book.getName()))){
                System.out.println("找到了");
                System.out.println(book);
                return;
            }
        }
        System.out.println("没有找到");
    }
}
